<div class="modal fade" id="detail-modal" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h4 class="" id="modal-title">操作日志</h4>
      </div>
      <div class="modal-body">
        <div class="row">
          <table class="table text-center table-striped table-hover">
            <thead>
              <tr>
                <td>操作</td>
                <td>操作人</td>
                <td>时间</td>
                <td>备注</td>
              </tr>
            </thead>
            <tbody>
              <% resource.logs.each do |log| %>
                <tr>
                  <td><%= t_enum log.action, resource.class, :log_actions %></td>
                  <td><%= log.user_name %></td>
                  <td><%= date_and_time log.created_at %></td>
                  <td>
                    <% if log.message && log.message.length > 9 %>
                      <span data-toggle="tooltip" data-placement="top" title="<%= log.loggable.try(:payment_method) %><%= log.message %>"><%= log.loggable.try(:payment_method) %><%= log.message[0..8] %>...</span>
                    <% else %>
                      <%= log.message %>
                    <% end %>
                  </td>
                </tr>
              <% end %>
            </tbody>
          </table>
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
  <script type="text/javascript">
    $('[data-toggle="tooltip"]').tooltip();
  </script>
</div>
